home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr38 / inputx.zip / INPUT.DOC < prev    next >
Text File  |  1993-04-16  |  21KB  |  489 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.         
  8.                             
  9.                             
  10.                             
  11.                             
  12.                             
  13.                             
  14.                             
  15.                             
  16.                             
  17.                             
  18.                             
  19.                             
  20.                             
  21.                             
  22.                             
  23.                             
  24.                             STEENBURGH'S STUFF
  25.                           Mildly Useful Utilities
  26.                               For Batch Files
  27.                                Version  2.51
  28.           Copyright 1991-1993 by Chuck Steenburgh and Tay-Jee Software
  29.         
  30.                             _______
  31.                        ____|__     |               (TM)
  32.                     --|       |    |-------------------
  33.                       |   ____|__  |  Association of
  34.                       |  |       |_|  Shareware
  35.                       |__|   o   |    Professionals
  36.                     -----|   |   |---------------------
  37.                          |___|___|    MEMBER
  38.         
  39.         
  40.         
  41.         
  42.         
  43.         
  44.         
  45.         
  46.         
  47.         
  48.         
  49.         
  50.         
  51.         
  52.         
  53.         
  54.         
  55.         
  56.         
  57.         
  58.         
  59.         
  60.         
  61.  
  62.                                      Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.         INPUT.EXE v2.2                                                  |
  69.         Copyright 1991-1993 by Chuck Steenburgh & Tay-Jee Software
  70.         
  71.            If you use batch files very often, you've probably acquired
  72.         a program called ASK.COM or QUERY.COM or something similar 
  73.         that allows you to ask questions and receive simple responses.
  74.         Usually, this involves typing an ECHO command with your
  75.         question, followed by ASK.COM or whatever.  If you do this
  76.         a lot, you will probably appreciate the fact the INPUT.EXE
  77.         will accomplish the jobs of both the ECHO and ASK commands.
  78.         Add to this the greater flexibility that INPUT.EXE offers
  79.         in presenting your prompt to the user and in receiving input,
  80.         and you'll be sold.
  81.         
  82.         Usage: INPUT ["prompt"] [nnn] [Options]
  83.                      
  84.         
  85.                   "prompt"        Enter the text you would like to
  86.                                   appear to prompt the user for
  87.                                   input.  This can be up to 59 char-
  88.                                   acters and must be enclosed in
  89.                                   quotation marks.
  90.         
  91.                   nnn             Enter a number representing the   
  92.                                   color in which you want your mes-
  93.                                   sage to appear.  You must, of
  94.                                   course, have a color monitor and
  95.                                   card.  See Appendix 3.
  96.            
  97.            Options:
  98.         
  99.                   /C              Include this switch if you want
  100.                                   your prompt message centered on
  101.                                   the current line.  If you include
  102.                                   this switch, you MUST include a
  103.                                   color value.
  104.                   
  105.                   /D              Display list of available disk drives
  106.                                   on current system and restrict input
  107.                                   to one of these letters.
  108.                   
  109.                   /Exxxxxx        Instead of returning errorlevel, ac-
  110.                                   cept text input which is supplied to
  111.                                   command "xxxxxx."
  112.                                   
  113.                   /H or /?        Display brief help screen.
  114.                   
  115.                   /I              Use this for a case-insensitive error
  116.                                   level return.  If this switch is
  117.                                   included on the command line, pressing
  118.                                   a letter a-z (lower case) will return
  119.                                   the same value as if the corresponding
  120.                                   key A-Z (upper case) were pressed.
  121.                   
  122.  
  123.                                      Page 2
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                   /Ln             Leftmost column in which prompt should
  130.                                   appear.
  131.                   
  132.                   /Mxxxxxx        Receive text input and set environment
  133.                                   variable xxxxxx with data received.
  134.                                   Defaults to variable name of INPUT if |
  135.                                   no name is provided.                  |
  136.                                   
  137.                   /Pd             Pause 10 seconds for user input, then 
  138.                                   default to "d" (where "d" is any char-
  139.                                   acter.  INPUT will wait up 10 seconds 
  140.                                   for user input.  If no key is pressed 
  141.                                   within 10 seconds, INPUT will act as  
  142.                                   if the key specified by the key rep-  
  143.                                   resented by the single character "d"  
  144.                                   was pressed.  Note that all other     
  145.                                   switches (case insensitivity, yes/no  
  146.                                   answer, etc.) remain active if time   
  147.                                   expires and the default key is used.  
  148.                                   INPUT adds a warning that it will de- 
  149.                                   fault to the specified value after 10 
  150.                                   seconds, and will display a succession
  151.                                   of ten dots to indicate elapsed time. 
  152.                                   
  153.                   /Q              Quiet mode.  Suppresses the audible
  154.                                   alarm prompt.
  155.                   
  156.                   /R              Row in which prompt should appear.
  157.                                   
  158.                   /S              Show keypress.  Adding this switch
  159.                                   will cause INPUT to display the
  160.                                   errorlevel value returned.  Use this
  161.                                   for quick "debugging" of your use
  162.                                   of INPUT.EXE
  163.                   
  164.                   /V              Instead of a single keypress, causes  
  165.                                   INPUT to read a numeric value (con-   
  166.                                   cluded with a carriage return) between
  167.                                   0 and 255 from the keyboard.  Values
  168.                                   less than 0 will return 0 and values
  169.                                   greater than 255 will return 255.
  170.                                   
  171.                   /Wn             When used in conjunction with the /P
  172.                                   switch, changes the default wait time
  173.                                   to n seconds, where n is no greater
  174.                                   than 999 seconds.
  175.                   
  176.                   /X              When used in conjunction with the /W 
  177.                                   and/or /P switches will suppress dis-
  178.                                   play of the default value and timer  
  179.                                   "ticks."
  180.                                   
  181.                   /Y              Use this for a yes-no only response.  
  182.                                   If the "n" key is pressed, errorlevel 
  183.  
  184.                                      Page 3
  185.  
  186.  
  187.  
  188.  
  189.  
  190.                                   of "0" is returned; pressing any other
  191.                                   key returns an errorlevel of 1.  The  
  192.                                   prompt "(Y/n)" is appended to the nor-
  193.                                   mal prompt specified by the user.     
  194.                                   
  195.                   /N              Use this for a yes-no only response.  
  196.                                   If the "y" key is pressed, errorlevel 
  197.                                   of "1" is returned; pressing any other
  198.                                   key returns an errorlevel of 0.  The  
  199.                                   prompt "(y/N)" is appended to the nor-
  200.                                   mal prompt specified by the user.     
  201.                                   This switch takes precedence over the 
  202.                                   /y switch.                            
  203.                                   
  204.                   The command line parameters may be entered in any 
  205.                   order, may be in any case, and may be preceded by 
  206.                   either the "/" or "-" character.     
  207.         
  208.         Examples:
  209.         
  210.              INPUT "Select a number from one to 10"
  211.         
  212.              This prints the text "Select on number from one to 10"
  213.         on the current line and waits for a keypress.
  214.         
  215.              INPUT "Press any key to continue" 79
  216.         
  217.              This prints the text "Press any key to continue" on the
  218.         current line in bright white on a red background and waits
  219.         for a keypress.
  220.         
  221.              INPUT "Press the space bar to exit" 143 /c
  222.         
  223.              This prints the text "Press the space bar to exit" cen-
  224.         tered on the current line in flashing bright white on a black
  225.         background.
  226.         
  227.              INPUT /s /i "Press any key..." /c 14
  228.              
  229.              Prompts user with "Press any key..." in yellow on black.
  230.         Returns a case-insensitive errorlevel and displays it on the
  231.         screen before terminating.
  232.         
  233.              INPUT "Do you wish to continue?" /s 79 /y              
  234.              
  235.              Prompts user with "Do you wish to continue? (Y/n)" in 
  236.         white on red.  Returns errorlevel of 1 unless the "n" key is
  237.         pressed.  Displays errorlevel on screen.
  238.         
  239.              INPUT "Press any key..." /pf                               
  240.              
  241.              Prompts user with "Press any key... (defaults to f after 
  242.         10 seconds)" in black on white.  Returns errorlevel of 102 if   
  243.         no key is pressed within 10 seconds, otherwise returns value of 
  244.  
  245.                                      Page 4
  246.  
  247.  
  248.  
  249.  
  250.  
  251.         key pressed.
  252.         
  253.              INPUT "Press any key..." /c /pf                         
  254.              
  255.              Prompts user with "Press any key... (defaults to f after   
  256.         10 seconds)" in black on white.  Returns errorlevel of 70 if no 
  257.         key is pressed within 10 seconds, otherwise returns the upper   
  258.         case ASCII value of the key pressed.                           
  259.         
  260.              INPUT "Enter data:" /p1 /w15 /q 30
  261.              
  262.              Prompts user with "Enter data: (defaults to 1 after 15
  263.         seconds)" in yellow on blue.  Returns errorlevel of 49 if no
  264.         key is pressed after 15 seconds, otherwise returns the error-
  265.         level of the key pressed.  The alarm does NOT sound.
  266.         
  267.              INPUT "How many copies should be printed? " /v /c
  268.              
  269.              Prompts user with "How many copies should be printed?"
  270.         centered on the current line.  A number can be entered by the
  271.         user and INPUT will return an errorlevel equal to the number
  272.         entered (between 0 and 255).  If the /V switch is used, the
  273.         data entered by the user will appear on screen, and can be
  274.         changed using backspace before pressing <Return>.
  275.         
  276.              INPUT "Press any key to continue..." /p /x
  277.              
  278.              Displays the familiar DOS PAUSE message, but exits after
  279.         a 10 second delay if no key is pressed.  An errorlevel of 0 is
  280.         returned.
  281.         
  282.              INPUT "Switch to which drive?" /D
  283.              
  284.              Displays prompt "Switch to which drive?" followed by a
  285.         list of all valid drives on the system.  Will not exit until
  286.         one of these drive letters is pressed.
  287.         
  288.              INPUT "Enter a directory mask " /Edir /C
  289.              
  290.              Centers prompt "Enter a directory mask " on screen.  Exe-
  291.         cutes DOS "dir" command, using any text entered in response to
  292.         prompt as arguments.  For example, if user typed "*.exe /p" the
  293.         command "dir *.exe /p" will be executed by INPUT.  This allows
  294.         INPUT to be used to enter limited string data.
  295.         
  296.             INPUT "Enter a file name: " /Wfilename
  297.             
  298.             Accepts text data from keyboard and places value entered
  299.         in the master environment in a variable named "filename."  This
  300.         value can later be accessed within a batch file or via other
  301.         programs.
  302.         
  303.            INPUT will also sound an alarm to let the user know that
  304.         a response is expected (unless /Q switch specified).
  305.  
  306.                                      Page 5
  307.  
  308.  
  309.  
  310.  
  311.  
  312.         
  313.            When a key is pressed, INPUT will set the errorlevel equal
  314.         to the ASCII value of the key pressed.  This is slightly dif-
  315.         ferent from BATBOX in that in normal operation INPUT is case
  316.         sensitive and will allow you to distinguish between upper and
  317.         lower case letters.  If you want a case-insensitive return, use
  318.         the /i switch.  See Appendix 2 for a complete list of the ASCII
  319.         characters theoretically supported by INPUT.  If the /H or /?
  320.         parameter was specified, the errorlevel returned will be 255.
  321.         
  322.            If you want greater control over the placement of your prompt
  323.         message on the screen, use WRITE in conjunction with INPUT.
  324.         Use WRITE to display your prompt then use INPUT without the
  325.         "prompt," color, or /c parameters.
  326.         
  327.            When using the /E parameter to execute a batch file, be sure
  328.         to include the extension ".BAT" as part of the switch.
  329.         
  330.            When using the /M switch to set an environment variable, the
  331.         variable name you supply will be converted to upper case.  DOS
  332.         will only recognize upper case variables within batch files.
  333.         
  334.            When using the /M switch in conjunction with /Y or /N, the   |
  335.         variable will be assigned a value of YES or NO as appropriate.  |
  336.         
  337.            SPECIAL NOTE TO 4DOS* USERS
  338.            
  339.            INPUT.EXE conflicts with 4DOS' INPUT internal command.  To
  340.         remedy this situation, create a batch file containing the two
  341.         lines below (or add them to your AUTOEXEC.BAT file) and execute
  342.         once each time your computer is turned on:
  343.         
  344.              alias input d:\path\input.exe
  345.              alias inp4 *input
  346.              
  347.            The first line creates an alias of "input" for the program 
  348.         INPUT.EXE.  The second line creates an alias of "inp4" for the
  349.         internal 4DOS INPUT command.  Make sure the "d:\path\" part of
  350.         the first line is replaced with the actual drive/path in which
  351.         INPUT.EXE is located on your system.  Since INPUT v2.11 performs
  352.         many more functions than the 4DOS command, it is desirable to
  353.         avoid any confusion and simply replace 4DOS' INPUT command.
  354.         
  355.         * 4DOS is a registered trademark of JP Software Inc.
  356.         
  357.          
  358.         OMBUDSMAN
  359.         
  360.           This program is produced by a member of the Association of
  361.         Shareware Professionals (ASP).  ASP wants to make sure that
  362.         the shareware principle works for you.  If you are unable to
  363.         resolve a shareware-related problem with an ASP member by
  364.         contacting the member directly, ASP may be able to help.  The
  365.         ASP Ombudsman can help you resolve a dispute or problem with
  366.  
  367.                                      Page 6
  368.  
  369.  
  370.  
  371.  
  372.  
  373.         an ASP member, but does not provide technical support for 
  374.         members' products.  Please write to the ASP Ombudsman at 545
  375.         Grover Road, Muskegon, MI 49442 or send a CompuServe message
  376.         via CompuServe Mail to ASP Ombudsman, 70007,3536.
  377.         
  378.         
  379.         DISCLAIMER
  380.         
  381.            The programs described in this documentation are guaran-
  382.         teed to do absolutely nothing!  They have, however, in my exper-
  383.         ience performed essentially as described herein.  The author
  384.         will not be responsible for any loss or damages caused through
  385.         the use of these programs.  No warranty, express or implied,
  386.         is provided for this software's performance, merchantability,
  387.         or fitness for a particular purpose.
  388.         
  389.            All trademarks are property of their respective owners.
  390.         
  391.            The programs and documentation are Copyright 1991,1992 by 
  392.         Chuck Steenburgh.  You are encouraged to distribute these pro-
  393.         grams provided the following conditions are met:
  394.         
  395.            - all files contained in the archive or distribution disk
  396.              must be distributed together in UNMODIFIED form
  397.         
  398.            - you charge no more than a reasonable fee for copying or
  399.              subscription, and clearly indicate that payment of such
  400.              a fee does NOT grant ownership of the programs.
  401.         
  402.            This program is part of set of utilities known as STEEN-
  403.         BURGH'S STUFF (Mildly Useful Utilities).  The full set of
  404.         utilities includes the following programs:
  405.         
  406.              BATBOX:     Simple menu creation/input system
  407.              CHKDRV:     Checks disk drive status
  408.              CHKPRN:     Checks parallel printer status
  409.              CLK:        Displays time on screen
  410.              CURSOR:     Change cursor shape
  411.              DOSVER:     Checks for DOS version currently running
  412.              INPUT:      Simple prompt/input system
  413.              KLS:        Colorful screen-clearing utility
  414.              LAUNCHER:   File selection/execution system
  415.              MUSIC:      Plays transcribed sheet music on the PC
  416.              RAND:       Random number generator
  417.              SKIP:       Prints blank lines from batch files
  418.              SOUNDER:    Wide range of noise making options
  419.              SPACE:      File/disk space reporting utility
  420.              WAITFOR:    Timed pauses 
  421.              WHENISIT:   Date/time telling utility
  422.              WRITE:      Colorful output anywhere on screen
  423.              XD:         Create/switch directories at the same time
  424.         
  425.            You may evaluate these programs for up to 30 days on a free
  426.         trial basis.  After 30 days, you should register your use of
  427.  
  428.                                      Page 7
  429.  
  430.  
  431.  
  432.  
  433.  
  434.         these programs.  The registration fee is $20, payable to the
  435.         author at the address given below.  For those registering
  436.         directly with Tay-Jee Software, we offer a $5 cash discount.
  437.         
  438.            Let's be real: I don't plan to make a lot of money this way.
  439.         Registration does have its advantages:
  440.         
  441.            - I am improving these programs all the time.  Registration
  442.              will get you IMMEDIATELY a disk with the latest version.
  443.              You will also get the next major release of the program set
  444.              sent to you free of charge.
  445.         
  446.            - While I can't promise to include everyone's suggestions
  447.              in program updates, you can bet I'll listen to registered
  448.              users before any of you scrounges out there.
  449.         
  450.            - You will make me feel all warm and fuzzy and appreciated, 
  451.              and all that good stuff.
  452.         
  453.            - You will also get an evaluation copy of my text file for-
  454.              matting program (used to produce the margins in this doc-
  455.              ument), and any other electronic creations I have decided
  456.              to unleash on a foolish, unsuspecting world.
  457.         
  458.            Send comments/registrations to:
  459.         
  460.                 Tay-Jee Software
  461.                 Post Office Box 835
  462.                 Lexington, VA 24450
  463.                 (703)464-5290
  464.                 
  465.                 !!!VIRGINIA RESIDENTS ADD 4.5SALES TAX!!!
  466.         
  467.                 CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
  468.         
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.                                      Page 8